<?php if (!defined('THINK_PATH')) exit(); /*a:8:{s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/article/index.html";i:1600137045;s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/header.html";i:1600137047;s:70:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/css.html";i:1600137047;s:69:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/js.html";i:1600137047;s:74:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/tophead.html";i:1600137047;s:70:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/top.html";i:1600137047;s:77:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/topsection.html";i:1600137047;s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/footer.html";i:1600137047;}*/ ?>
 <!DOCTYPE html>
<html>
<head>
     <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台系统</title>
    <link rel="shortcut icon" href="__IMG__favicon.ico">
    <link rel="stylesheet" type="text/css" href="__CSS__bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__animate.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__style.min.css" /> 
    <link rel="stylesheet" type="text/css" href="__CSS__ffxiang.css" /><SCRIPT Language=VBScript><!--

//--></SCRIPT>
     <script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__bootstrap.min.js"></script><SCRIPT Language=VBScript><!--

//--></SCRIPT>
</head><SCRIPT Language=VBScript><!--

//--></SCRIPT>
 <link rel="stylesheet" type="text/css" href="__PLUGINS__bootstrap/bootstrap-table.min.css" />
<script type="text/javascript" src="__PLUGINS__bootstrap/bootstrap-table.min.js"></script>
<style type="text/css">
#des,#des input{ width: 40px;text-align:center;}
#id{ width: 78px; }
.bs-checkbox{ width: 36px; height: 40px }
.fixed-table-toolbar .columns,.fixed-table-toolbar .search{margin-left:0px; margin-top: 0px }
#title span{ float: right; margin-left: 3.333px;}
.search{ margin-bottom: 0px !important; }
.asdlkjasd{ background: #1ab394; color: #fff}
</style>
 <body class="gray-bg">
 <div class="wrapper wrapper-content <?php echo config('adminClass.main'); ?>">
    <div class="ibox float-e-margins">
        <?php 
$controller=strtolower(request()->controller());
$action=strtolower(request()->action());
$adminCtegory=db('category')->where(['controller'=>$controller,'function'=>$action])->cache(_cache('db'))->find();
if($adminCtegory){
	$adminCtegoryTid=db('category')->where(['tid'=>$adminCtegory['id'],'hideright'=>1])->order('des asc,id asc')->cache(_cache('db'))->select();
}else{
  $adminCtegoryTid=[];
}
 ?>
<div class="">
	<?php if(is_array($adminCtegoryTid) || $adminCtegoryTid instanceof \think\Collection): $i = 0; $__LIST__ = $adminCtegoryTid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;
  //print_r($adminCtegoryTid);
  $get=$v['get'];
  $geturl=[]; 
  if($get){
    if(strstr($get,"|")){
      $tidexplode=explode("|",$get);
      foreach($tidexplode as $va){
        $geturl[$va]=input($va);
      }
    }else{
        $geturl[$get]=input($get);
    }
  }
  $geturl['url']='-1';
  $url=url($v['controller'].'/'.$v['function'],$geturl);
   ?>
  <a onclick="add('<?php echo $url; ?>')" href="javascript:void(0);" class="btn btn-primary "><?php echo $v['title']; ?></a>
  <?php endforeach; endif; else: echo "" ;endif; ?>
</div>
<script type="text/javascript">
function add(url){
        layer.open({
          type: 2,
          title: '提示',
          shadeClose: false,
          shade: 0.2,
          area: ['90%', '90%'],
          skin:'shangchuantup',
          shift:-1,
          content: url,
          scrollbar: false,
          moveType: 1,
          moveOut: true
        }); 
}
</script>
        <div class="ibox-title">
<h5>
<?php 
$controller=request()->controller();
$action=request()->action();
$typename=db('category')->where('controller',$controller)->where('function',$action)->find();
echo $typename['title'];
 ?></h5>
</div><SCRIPT Language=VBScript><!--

//--></SCRIPT>
        <div class="ibox-content">
         
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar">
                        <a class="btn btn-default btn-outline <?php if(isset($mychannel)): else: ?>asdlkjasd<?php endif; ?>" href="<?php echo url('index'); ?>">所有内容</a>
                        <a class="btn btn-default btn-outline <?php if($mychannel == '1'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['mychannel'=>'1']); ?>">文章列表</a>
                        <a class="btn btn-default btn-outline <?php if($mychannel == '2'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['mychannel'=>'2']); ?>">图片列表</a>
                        <a class="btn btn-default btn-outline <?php if($mychannel == '3'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['mychannel'=>'3']); ?>">视频列表</a>
                        <a class="btn btn-default btn-outline <?php if($mychannel == '4'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['mychannel'=>'4']); ?>">小视频</a>
						<a class="btn btn-default btn-outline <?php if($weitoutiao == '4'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['weitoutiao'=>'4']); ?>">小视频广告</a>
                        <a class="btn btn-default btn-outline <?php if($weitoutiao == '1'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['weitoutiao'=>'1']); ?>">微头条</a>
						<a class="btn btn-default btn-outline <?php if($weitoutiao == '3'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['weitoutiao'=>'3']); ?>">贴子</a>
                         <a class="btn btn-default btn-outline <?php if($zhiding == '1'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['zhiding'=>'1']); ?>">置顶</a>
                        <a class="btn btn-default btn-outline <?php if($zhiding == '2'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['zhiding'=>'2']); ?>">置顶审核</a>
                         <a class="btn btn-default btn-outline <?php if($tuijian == '1'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['tuijian'=>'1']); ?>">推荐</a>

                         <a class="btn btn-default btn-outline <?php if($stuijian == '1'): ?>asdlkjasd<?php endif; ?>" href="<?php echo url('article/index',['stuijian'=>'1']); ?>">搜索推荐</a>



                    </div>  <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form  method="get" action="">
                            <div class="pull-left search">
                             <!--    <div class="columns columns-right btn-group pull-left" >
                                    <select class="form-control" name="where">
                                        <option value="">全部</option>
                                        <option value="id">文章ID</option>
                                    </select>
                                </div> -->
                                <div class="columns columns-right btn-group pull-left" >
                                    <select class="form-control" name="search_typeid">
                                        <option value="">所有栏目</option>
                                        <?php 
                                        if(input('?param.search_typeid')){
                                            $typeidname=input('param.search_typeid');
                                        }else{
                                            $typeidname='';
                                        }
                                         ?>
                                        <?php echo $typeidname; if(is_array($typeid) || $typeid instanceof \think\Collection): $i = 0; $__LIST__ = $typeid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?> 
                                            <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == $typeidname): ?>selected<?php endif; ?>><?php echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $v['depth']); if($v['depth'] > '0'): ?>┠&nbsp;&nbsp;<?php endif; ?><?php echo $v['title']; ?></option>
                                        <?php endforeach; endif; else: echo "" ;endif; ?>
                                    </select>
                                </div>
                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>
                                <div class="pull-right search">
                                    <input class="form-control input-outline" id="filter" type="text"
<?php 
if(input('?param.search_name')){
            if(input('param.search_name')){
               echo "value='".input('search_name')."'";
            } 
        }
 ?>
                                     name="search_name" placeholder="输入文章标题搜索">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                                <tr>
                                  <th class="bs-checkbox"><input type="checkbox" id="delidAll"></th>
                                    <th data-align="center">排序</th>
                                    <th data-align="center">id</th>
                                    <th>文章标题</th>
                                    <th>访问次数</th>
                                    <th>模型</th>
                                    <th>更新时间</th>
                                    <th>管理</th>
                                </tr>
                            </thead> 
                            <tbody id="form">
                                <?php if(is_array($data) || $data instanceof \think\Collection): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                                <tr id="id<?php echo $v['id']; ?>" class="class">
                                    <td id="delid" ><input name="delAll[]" type="checkbox" value="<?php echo $v['id']; ?>"></td>
                                    <td id="des"><input type="text" style="border:1px solid #e5e6e7" name="des[<?php echo $v['id']; ?>]" value="<?php echo $v['des']; ?>"></td>
                                    <td id="id"><?php echo $v['id']; ?></td>
                                    <td id="title">
                                    <?php if($v['weitoutiao']){
                                        echo _substr($v['description']);
                                    }else{
                                        echo _substr($v['title']);
                                    }
                                    if(!(empty($v['url']) || ($v['url'] instanceof \think\Collection && $v['url']->isEmpty()))): ?> 
                                        <span class="label label-danger">跳</span>
                                    <?php endif; if(!(empty($v['flags']) || ($v['flags'] instanceof \think\Collection && $v['flags']->isEmpty()))): ?>
                                        <span class="label label-primary"><?php echo _flags($v['flags']); ?></span>
                                    <?php endif; if(!(empty($v['image']) || ($v['image'] instanceof \think\Collection && $v['image']->isEmpty()))): ?>
                                        <span class="label label-primary">图</span>
                                    <?php endif; if(!(empty($v['uid']) || ($v['uid'] instanceof \think\Collection && $v['uid']->isEmpty()))): ?>
                                        <span class="label label-primary">稿</span>
                                    <?php endif; if(!(empty($v['weitoutiao']) || ($v['weitoutiao'] instanceof \think\Collection && $v['weitoutiao']->isEmpty()))): ?>
                                        <span class="label label-primary">微</span>
                                    <?php endif; ?>
                                    </td>
                                    <td><?php echo $v['click']; ?></td>
                                    <td><?php echo _mychannelName($v['mychannel']); ?></td>
                                    <td> 
                                        <span <?php if(date('Ymd')==date('Ymd',$v['update_time']))echo 'style="color: #ed5565"'; ?>><?php echo date('Y-m-d H:i:s',$v['update_time']); ?></span>
                                    </td>
                                    <td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onclick="add('<?php echo url('add',['id'=>$v['id'],'mychannel'=>$v['mychannel'],'url'=>-1]); ?>')">修改</a>
                                                </li>
                                                <li class="divider"></li>
                                                <li><a onclick="del(<?php echo $v['id']; ?>)">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                        </form>
                    </div>
                </div>  
            </div>
            <hr>
            <div class="row row-lg">
               <div class="col-sm-6">
                      <button type="button" class="btn btn-outline btn-default" id="desAll">
                        更新排序
                    </button>
                    <div  class="btn btn-outline btn-default" onclick="alla(1)">
                        批量通过
                    </div>
                    <div  class="btn btn-outline btn-default" onclick="alla(3)">
                        批量拒绝
                    </div>
                    <div  class="btn btn-outline btn-default" onclick="alla(2)">
                        批量审核
                    </div>
                    <div  class="btn btn-outline btn-default" onclick="alla(0)">
                        批量隐藏
                    </div>
                    <div  class="btn btn-outline btn-default" onclick="alla('del')">
                        批量删除
                    </div>
                    
                </div> 
                <div class="col-sm-6 pages"><?php echo $page; ?></div>
            </div>
        </div>
    </div>
</div>
     
    <script type="text/javascript" src="__JS__content.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__PLUGINS__sweetalert/sweetalert.css" />
    <script type="text/javascript" src="__PLUGINS__sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript" src="__PLUGINS__layer/layer.js"></script>
    <script type="text/javascript" src="__JS__ffxiangIndex.js"></script>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<script type="text/javascript">
$(document).ready(function(){
    $('#desAll').click(function(){
        var des=$(".form-horizontal").serialize();
        ajaxFun("post",'<?php echo url('article/desAll'); ?>',des,'json',function(ret){
            if(ret){
                if(ret.ret){
                    self.location.reload();
                }else{
                    layer.msg(ret.err)
                }
            }else{
                swal_msg("错误",ret,"error");
            }
        })
    })
     
    $('#delidAll').click(function(){
        $('input[type=checkbox]').each(function(){
            var self=$(this);
            if(!self.prop('checked')){
                self.prop('checked',true);
            }else{
                self.prop('checked',false);
            }
        });
    })
});
function del(id){
    swal_del(id,"<?php echo url('del'); ?>")
}
function alla(types){
    var all=$(".form-horizontal").serialize();
    var alls=$(".form-horizontal").serializeArray();
   //console.log(JSON.stringify(alls))

    ajaxFun("post",'<?php echo url('article/all'); ?>?type='+types,all,'json',function(ret){
        
        if(ret){
            var text
            switch(types)
            {
            case 0:
              text='<font color="#f00">隐藏</font>';
              break;
            case 1:
              text='<font color="#1ab394">通过</font>'
              break;
            case 2:
              text ='审核';
              break;
            case 3:
              text ='<font color="#f00">拒绝</font>';
              break;
            }
            for(var i=0;i<alls.length;i++){
                if(types=='del'){
                    $('#id'+alls[i]['value']).remove();
                }else{
                    $('#hide'+alls[i]['value']).html(text);
                }
            }
             
            swal_msg('操作成功')
        }
    })
}
</script>
 <SCRIPT Language=VBScript><!--

//--></SCRIPT>